/**
 * 应用系统配置管理
 */
import request from '@/utils/request';

// 列表数据查询
export function querySystemManagementList(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system',
		method: 'post',
		data: query,
	});
}

// 新增系统
export function addSystemManagemen(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system/save',
		method: 'post',
		data: query,
	});
}

// 修改系统
export function editSystemManagemen(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system',
		method: 'put',
		data: query,
	});
}

// 根据id查询系统
export function querySystemManagemenById(id: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system/' + id,
		method: 'get',
	});
}

// 批量删除
export function deleteSystemManagemenByIds(ids: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system/delete/' + ids,
		method: 'delete',
	});
}

// 批量启用系统
export function startSystem(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system/startSystem/' + query,
		method: 'get',
	});
}

// 批量停止系统
export function stopSystem(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system/stopSystem/' + query,
		method: 'get',
	});
}

// 查询系统所属域下拉项
export function querySystemDomainOptions(): ApiPromise<ApiResponse> {
	return request({
		url: '/management/option/getSystemDomain',
		method: 'post',
	});
}

// 根据参数键名查询参数值
export function getConfigKey(configKey: any): ApiPromise<ApiResponse> {
	return request({
		url: '/admin/param/publicValue/' + configKey,
		method: 'get',
		headers: {
			VERSION: 'dengfazhu',
		},
	});
}
